import { FGTeamItem } from "./FGTeamItem";
import { FGLineLink } from "./FGLineLink";
import { ObjCreate } from "../common/ObjCreate";
import { GTextFormat } from "../../../common/GTextFormat";
import { FootBallGameConst } from "./FootBallGameConst";
import { FGTeamInfo } from "./FGTeamInfo";
//class FGSemiFinalItem
    
    export  class FGSemiFinalItem /* flash.display.Sprite */
    {
        constructor(arg1: Boolean=false)
        {
            
            this._isLeft = arg1;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._teamItemA = new FGTeamItem();
            this.addChild(this._teamItemA);
            this._teamItemB = new FGTeamItem();
            this._teamItemB.y = 168;
            this.addChild(this._teamItemB);
            this.lineLink = new FGLineLink();
            this.lineLink.x = 67;
            this.lineLink.y = 9.5;
            this.addChild(this.lineLink);
            this._timeTxt = ObjCreate.createTextField("", -18, 82, 220, 20, this, new GTextFormat(null, null, FootBallGameConst.matchTimeColor));
            this._timeTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._timeTxt.mouseEnabled = false;
            if (this._isLeft) 
            {
                this.lineLink.scaleX = -1;
                this.lineLink.x = -27;
                this.lineLink.y = 7.5;
            }
            return;
        }

        public updateByTeamInfo(arg1: FGTeamInfo): void
        {
            this._teamInfo = arg1;
            if (this._teamInfo) 
            {
                this._teamItemA.updateTeamInfo(this._teamInfo.gameInfo.teamA, this._teamInfo.gameInfo.teamAName);
                this._teamItemB.updateTeamInfo(this._teamInfo.gameInfo.teamB, this._teamInfo.gameInfo.teamBName);
                this._teamItemA.teamInfo = this._teamInfo;
                this._teamItemB.teamInfo = this._teamInfo;
                this.lineLink.teamInfo = this._teamInfo;
                this._timeTxt.text = FootBallGameConst.getGuessDateTip(this._teamInfo.gameInfo.gameDt);
            }
            return;
        }

        /* internal */ /* var */_isLeft: Boolean;

        /* internal */ /* var */_teamItemA: FGTeamItem;

        /* internal */ /* var */_teamItemB: FGTeamItem;

        /* internal */ /* var */_timeTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */lineLink: FGLineLink;

        /* internal */ /* var */_teamInfo: FGTeamInfo;
    }
